docs: add CustomHealth Lua authoring guide - #617
Conversation
There was a problem hiding this comment.
This PR was generated by the codex Plural Agent Runtime. Here's some useful information you might want to know to evaluate the ai's perfomance:
| Name | Details |
|---|---|
| 💬 Prompt | Create a new clean replacement PR in this repository for CustomHealth docs. It must explicitly supersede the closed prior PR #616; do not reuse or iterate on that branch/PR. Inspect #616 if accessible only for context and ensure the new PR is focused and does not carry forward unverified claims.... |
| 🔗 Run history | View run history |
Greptile SummaryAdds an example-first guide for authoring deployment-operator
Confidence Score: 4/5The documentation should not merge until the Lua input global is corrected, because copying the primary example currently produces a runtime script failure. The guide consistently dereferences lowercase Files Needing Attention: pages/plural-features/continuous-deployment/deployment-operator/custom-health.md
|
| Filename | Overview |
|---|---|
| pages/plural-features/continuous-deployment/deployment-operator/custom-health.md | Adds the authoring guide, but its example and prose use a case-sensitive Lua input global that differs from the operator runtime. |
| src/routing/docs-structure.ts | Adds the new guide to the deployment-operator navigation using the expected path and nesting. |
| generated/routes.json | Adds a generated route whose path and markdown target match the new page. |
Reviews (1): Last reviewed commit: "docs: add CustomHealth Lua authoring gui..." | Re-trigger Greptile
| version: v1 | ||
| kind: Widget | ||
| script: | | ||
| -- obj is the target Kubernetes resource. |
|
A few improvments:
apiVersion: deployments.plural.sh/v1alpha1
kind: CustomHealth
metadata:
name: example-ready-condition
namespace: <namespace>
spec:
group: example.io
version: v1
kind: Example
script: |
healthStatus = { status = "Unknown" }
if Obj.status ~= nil and statusConditionExists(Obj.status, "Ready") then
healthStatus = { status = "Progressing" }
if isStatusConditionTrue(Obj.status, "Ready") then
healthStatus = { status = "Healthy" }
end
end
|
There was a problem hiding this comment.
🔧 Deploy preview for docs-pr-617 is building...
| Name | Details |
|---|---|
| ⚡ Service | docs-pr-617 (4 / 5 ready) |
| ☁️ Cluster | plural (eks) |
| e7793c4 | |
| https://console.mgmt.plural.sh/cd/clusters/446acdef-8524-425a-a49f-5336a... | |
| 🔍 Logs URL | https://console.mgmt.plural.sh/cd/clusters/446acdef-8524-425a-a49f-5336a... |
| 🌊 Flow URL | https://console.mgmt.plural.sh/flows/08a17af1-8578-449e-9ae1-28ccd97eafc... |
| Preview Link | Preview |
You can learn more about preview environments and Plural Flows here
|
|
||
| `CustomHealth` is a deployment-operator API, so apply it to each cluster where it should be used. To distribute the same resource across a fleet, use a [GlobalService](/plural-features/continuous-deployment/global-service). | ||
|
|
||
| Start with a complete manifest. This example targets `example.io/v1`, `Example` resources and evaluates their `Ready` condition. |
There was a problem hiding this comment.
This is a bit clunky, just introduce this as "Here's an example manifest:"
| kind: CustomHealth | ||
| metadata: | ||
| name: example-ready-condition | ||
| namespace: <namespace> |
There was a problem hiding this comment.
don't include namespace
| end | ||
| ``` | ||
|
|
||
| Set `metadata.name` and `metadata.namespace` for the `CustomHealth` resource. Set `spec.group`, `spec.kind`, and, when needed, the optional `spec.version` to identify the target GVK. Put the Lua code in `spec.script`. |
There was a problem hiding this comment.
don't explain you need to set metadata.name/namespace, that's true for every k8s resource.
Summary
obj,healthStatus, allowed-status, and supported-helper contract.Validation
docker run --rm -v "$PWD":/app -w /app node:22-alpine sh -lc 'apk add --no-cache git >/dev/null && git config --global --add safe.directory /app && corepack enable && yarn generate:route-index'docker run --rm -v "$PWD":/app -w /app node:22-alpine sh -lc 'apk add --no-cache git >/dev/null && git config --global --add safe.directory /app && corepack enable && yarn lint'— passed with 13 existing CSS compatibility warnings and no errors.docker run --rm -v "$PWD":/app -w /app node:22-alpine sh -lc 'apk add --no-cache git >/dev/null && git config --global --add safe.directory /app && corepack enable && yarn build'— passed.Supersedes #616
This is a clean replacement PR created on a new branch, focused on authoring CustomHealth Lua. It intentionally excludes unsupported implementation claims, including sandboxing, standard-library availability, precedence, namespace semantics, controller mechanics, and detailed error behavior.
Plural Flow: docs
Plural Preview: docs